home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / c / genmo112.lha / GTB-Modula / Modules / GetFile.mod < prev    next >
Encoding:
Modula Implementation  |  1993-09-05  |  2.2 KB  |  83 lines

  1. IMPLEMENTATION MODULE GetFile;
  2.  
  3. (*
  4.  * -------------------------------------------------------------------------
  5.  *
  6.  *    :Module.    GetFile
  7.  *    :Contents.    interface to JaBa's GetFile-BOOPSI-Object
  8.  
  9.  *    :Author.    Reiner Nix
  10.  *    :Address.    Geranienhof 2, 5000 Köln 71 Seeberg
  11.  *    :Address.    rbnix@pool.informatik.rwth-aachen.de
  12.  *    :Language.    Modula-2
  13.  *    :Translator.    M2Amiga A-L V3.3d
  14.  *    :History.    this interface is a direct descendent from the oberon interface
  15.  *    :History.    GetFile.mod v1.0 by Kai Bolay [kai] 09-Apr-93
  16.  *    :Imports.    bases.o, boopsi.o 
  17.  *    :Usage.        import module and link with »-l fullpath/bases.o -l fullpath/boopsi.o«
  18.  * -------------------------------------------------------------------------
  19.  *)
  20.  
  21.  
  22. (*
  23.  * --- Environment for GetFile gadget -------------------------------------------
  24.  * This module gives access to the boopsi gadget Getfile.
  25.  *
  26.  * You requiere the object files 'boopsi.o' and 'bases.o'.
  27.  *
  28.  * Link this module using the 'l' option to specify the additional
  29.  * object modules:
  30.  * (Assuming a program 'Test' wich uses this module 'GetFile'.)
  31.  *
  32.  *  m2l  -lboopsi.o  -lbases.o  Test
  33.  *
  34.  *
  35.  * In 'boopsi.o' the GetFile gadget is defined. The gadget is initialized
  36.  * calling the routine '_initGadget'.
  37.  *
  38.  * The result is a pointer to the created class. It is stored in
  39.  * 'GetFileClass' for your own use.
  40.  *
  41.  * Using '_initGadget' requieres already set basepointers of intuition,
  42.  * graphics, utility and gadtools libraries.
  43.  * Because it is impossible to define extern labels with intern M2Amiga
  44.  * Assembler we need the additional object file 'bases.o' doing the job.
  45.  *
  46.  * ------------------------------------------------------------------------------
  47.  *)
  48.  
  49. FROM    SYSTEM        IMPORT    ASSEMBLE;
  50. FROM    IntuitionL    IMPORT    FreeClass;
  51.  
  52. IMPORT    IntuitionL;
  53. IMPORT    GraphicsL;
  54. IMPORT    UtilityL;
  55. IMPORT    GadToolsL;
  56.  
  57.  
  58. VAR    dummy        :BOOLEAN;
  59.  
  60.  
  61. BEGIN
  62. ASSEMBLE
  63. (
  64.     XREF    _IntuitionBase, _GfxBase, _UtilityBase, _GadToolsBase
  65.     XREF    _initGet
  66.  
  67.     MOVE.L    IntuitionL(A4),    _IntuitionBase
  68.     MOVE.L    GraphicsL(A4),    _GfxBase
  69.     MOVE.L    UtilityL(A4),    _UtilityBase
  70.     MOVE.L    GadToolsL(A4),    _GadToolsBase
  71.  
  72.     JSR    _initGet
  73.     MOVE.L    D0,        GetFileClass(A4)
  74.     END
  75. )
  76.  
  77. CLOSE
  78. IF GetFileClass # NIL THEN
  79.   dummy := FreeClass (GetFileClass);
  80.   GetFileClass := NIL
  81.   END
  82. END GetFile.
  83.